FROM php:8.0.2-fpm-buster

COPY --from=mlocati/php-extension-installer /usr/bin/install-php-extensions /usr/local/bin/
COPY --from=composer /usr/bin/composer /usr/bin/composer
COPY ./ini/*  "$PHP_INI_DIR/conf.d/"
COPY ./conf/*  /usr/local/etc/php-fpm.d/

RUN  sed -i 's/deb.debian.org/mirrors.ustc.edu.cn/g' /etc/apt/sources.list

#ADD sources.list /etc/apt
RUN  apt update && apt-get install -y git zip unzip \
    && install-php-extensions pdo_mysql redis opcache gd
#    && composer config -g repo.packagist composer https://mirrors.aliyun.com/composer/ \
#    && mv "$PHP_INI_DIR/php.ini-production" "$PHP_INI_DIR/php.ini"
#    && mv "$PHP_INI_DIR/php.ini-development" "$PHP_INI_DIR/php.ini"

WORKDIR /var/www
CMD  php-fpm
EXPOSE 9000
